package com.liguangting.agentsflex.simple;

import com.agentsflex.core.llm.ChatContext;
import com.agentsflex.core.llm.Llm;
import com.agentsflex.core.llm.StreamResponseListener;
import com.agentsflex.core.llm.response.AiMessageResponse;
import com.agentsflex.llm.qwen.QwenLlm;
import com.agentsflex.llm.qwen.QwenLlmConfig;
import com.liguangting.agentsflex.constant.ApiKeys;


/**
 * @author liguangting
 * @date 2024/7/4
 * @description
 */
public class QwenLlmTest {

    public static void main(String[] args) {
        QwenLlmConfig config = new QwenLlmConfig();
        config.setApiKey(ApiKeys.QWEN_API_KEY);
        Llm llm = new QwenLlm(config);
        llm.chatStream("地址：浙江省杭州市西湖区西湖大道1号，按省份、城市、区县、详细地址的json格式返回", new StreamResponseListener<AiMessageResponse>() {

            @Override
            public void onMessage(ChatContext context, AiMessageResponse response) {
                System.out.print(response.getMessage().getContent());
            }
        });
    }
}
